#ifndef ITERATORVECTOR_H_INCLUDED
#define ITERATORVECTOR_H_INCLUDED

namespace CEngine {

template<class E, class K>
Iterator<E,K>::Iterator(const typename Vector<E>::VectorIterator& it)
    :   type(Vector)
{
    iteratorData.vector.basePointer = it.basePointer;
    iteratorData.vector.currentElement = it.currentPointer;
}

template<class E, class K>
Iterator<E,K>&
Iterator<E,K>::operator=(const typename Vector<E>::VectorIterator& it) {
    type = Vector;
    iteratorData.vector.basePointer = it.basePointer;
    iteratorData.vector.currentElement = it.currentPointer;
    return *this;
}

template<class E, class K>
bool Iterator<E,K>::operator==(const typename Vector<E>::VectorIterator& it) const {
    ASSERT(type == Vector);

    if(iteratorData.vector.currentElement == it.currentPointer) {
        return true;
    }
    return false;
}

template<class E, class K>
bool Iterator<E,K>::operator!=(const typename Vector<E>::VectorIterator& it) const {
    ASSERT(type == Vector);

    if(iteratorData.vector.currentElement != it.currentPointer) {
        return true;
    }
    return false;
}

template<class E, class K>
bool Iterator<E,K>::operator>(const typename Vector<E>::VectorIterator& it) const {
    ASSERT(type == Vector && iteratorData.vector.basePointer == it.basePointer);

    if(iteratorData.vector.currentElement > it.currentPointer) {
        return true;
    }
    return false;
}

template<class E, class K>
bool Iterator<E,K>::operator<(const typename Vector<E>::VectorIterator& it) const {
    ASSERT(type == Vector && iteratorData.vector.basePointer == it.basePointer);

    if(iteratorData.vector.currentElement < it.currentPointer) {
        return true;
    }
    return false;
}

template<class E, class K>
bool Iterator<E,K>::operator>=(const typename Vector<E>::VectorIterator& it) const {
    ASSERT(type == Vector && iteratorData.vector.basePointer == it.basePointer);

    if(iteratorData.vector.currentElement >= it.currentPointer) {
        return true;
    }
    return false;
}

template<class E, class K>
bool Iterator<E,K>::operator<=(const typename Vector<E>::VectorIterator& it) const {
    ASSERT(type == Vector && iteratorData.vector.basePointer == it.basePointer);

    if(iteratorData.vector.currentElement <= it.currentPointer) {
        return true;
    }
    return false;
}

}

#endif // ITERATORVECTOR_H_INCLUDED
